<template>
  <div class="app-tabbar-vant">
    <van-tabbar v-model="active" route>
      <van-tabbar-item
        v-for="tab in tabs"
        :key="tab.path"
        :icon="tab.meta.icon"
        :to="tab.path"
      >{{tab.meta.title}}</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
import routes from '@/router/routes'

export default {
  name: 'AppTabbarVant',
  data() {
    return {
      active: 0,
    }
  },
  computed: {
    tabs() {
      const result = routes.filter(route => {
        return route.meta && route.meta.inTabbar
      })
      console.log('tabs:', result)
      return result
    },
  },
}
</script>

<style lang="less" scoped>

</style>
